/**
 * Copyright (c) 2009 Teoti Graphix, LLC See:
 *     http://tkarchitecture.teotigraphix.org
 * 
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 * 
 * @author Michael Schmalle mschmalle@teotigraphix.com
 */
package org.example.ui.component.supportClasses
{

import org.example.ui.behavior.LoginComponentBehaviorCore;
import org.example.ui.model.LoginComponentModelCore;
import org.example.ui.skin.LoginSkin;
import org.teotigraphix.dx.interfaces.IComponentBehaviorCore;
import org.teotigraphix.dx.interfaces.IComponentModelCore;
import org.teotigraphix.dx.interfaces.IComponentSkinCore;
import org.teotigraphix.dx.patterns.component.ToolKitFactory;

/**
 * The <code>LoginComponent</code>'s toolkit factory.
 * 
 * <p>Creates;</p>
 * <ul>
 * <li>coreModel - LoginComponentModelCore</li>
 * <li>coreSkin - LoginSkin</li>
 * <li>coreBehavior - LoginComponentBehaviorCore</li>
 * </ul>
 * 
 * @author Michael Schmalle
 * @copyright Teoti Graphix, LLC
 */
public class LoginComponentToolKitFactory 
	   extends ToolKitFactory
{
	//--------------------------------------------------------------------------
	//
	//  Overridden Public :: Variables
	//
	//--------------------------------------------------------------------------
	
	/**
	 * @inheritDoc
	 * @uses org.example.ui.model.LoginComponentModelCore
	 */
	override public function createCoreModel():IComponentModelCore
	{
		return (coreModel) ? coreModel : new LoginComponentModelCore();
	}
	
	/**
	 * @inheritDoc
	 * @uses org.example.ui.skin.LoginSkin
	 */
	override public function createCoreSkin():IComponentSkinCore
	{
		return (coreSkin) ? coreSkin : new LoginSkin();
	}
	
	/**
	 * @inheritDoc
	 * @uses org.example.ui.behavior.LoginComponentBehaviorCore
	 */
	override public function createCoreBehavior():IComponentBehaviorCore
	{
		return (coreBehavior) ? coreBehavior : new LoginComponentBehaviorCore();
	}
	
	//--------------------------------------------------------------------------
	//
	//  Public Class :: Methods
	//
	//--------------------------------------------------------------------------
	
	/**
	 * @private
	 */
	private static var instance:LoginComponentToolKitFactory;
	
	/**
	 * Returns the single instance of the factory.
	 * @uses org.example.ui.component.supportClasses.LoginComponentToolKitFactory
	 */	
	public static function getInstance():LoginComponentToolKitFactory
	{
		if (!instance)
			instance = new LoginComponentToolKitFactory();
		return instance;
	}
}
}